<link href="images/skin.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="css/custom-theme/jquery-ui-1.8.13.custom.css" rel="stylesheet" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}

.error {
	color: red;
}
-->
</style>
<script charset="utf-8" src="kindeditor-4.0.2/kindeditor.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="js/booking1.js"></script>

<script>
	function handleChange(cb) {
		if(cb.checked)
			location.href= ("orders_add.php?recordChecked=checked");
		else
			location.href= ("orders_add.php?");
	}
	
	function changeF() {
		document.getElementById('destination').value = document
				.getElementById('destination_select').options[document
				.getElementById('destination_select').selectedIndex].value;
		document.getElementById('origin').value = document
				.getElementById('origin_select').options[document
				.getElementById('origin_select').selectedIndex].value;

	}
	
	function changeF1() {
		// 从下面的赋值可以的值，你在action 中只要得到name =“ccdd” 的值就可以了。  
		document.getElementById('location').value = document
				.getElementById('location_select').options[document
				.getElementById('location_select').selectedIndex].value;
		document.getElementById('detail').value = document
		.getElementById('detail_select').options[document
		.getElementById('detail_select').selectedIndex].value;
		
	}

	$(document).ready(function() {
		var editor;
		KindEditor.ready(function(K) {
			K('select[name=charset]').change(function() {
				if (editor) {
					editor.remove();
					editor = null;
				}
				editor = K.create('textarea[name="content"]', {
					langType : this.value
				});
			});
			K('select[name=charset]').change();
		});
		$("#domain").validate({
			rules : {
				orderId : "required",
				origin : "required",
				items : "required",
				items : "number",
				datepicker : "required",
				datepicker : "date",
				detail : "required",
				location : "required"
			},
			messages : {
				orderId : "Order number required.",
				origin : "Origin required.",
				items : "Number of items required.",
				items : "Please enter a valid number.",
				datepicker : "time required.",
				datepicker : "please enter a valid date",
				detail : "detail required.",
				location : "location required."
			},
			errorPlacement : function(error, element) {
				error.appendTo(element.parent().parent().next().empty());
			}
		});
	});
</script>

<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" valign="top" background="images/mail_leftbg.gif"><img
				src="images/left-top-right.gif" width="17" height="29" /></td>
			<td valign="top" background="images/content-bg.gif"><table
					width="100%" height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"></td>
					</tr>
				</table></td>
			<td width="16" valign="top" background="images/mail_rightbg.gif"><img
				src="images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>

		<tr>
			<td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9">
				<form id="domain" action="orders_add.php?act=add" method="post">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<br>
						<tr class="nowtable">
							<td class="left_bt2" style="padding-left: 10px;" colspan="2">Add
								New Order</td>
						</tr>
						<tr>
							<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;" align="left">order id：<span
								style="padding-left: 36px;"> <textarea
										style="width: 188px; vertical-align: top" name="orderId"
										value="<{$list.orderId}>"></textarea></span>
							</td>
							<td bgcolor="#f2f2f2" class="left_txt"></td>
						</tr>
						<tr>
							<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;" align="left">origin：&nbsp;
								&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span
								style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
									<select name="origin_select" id="origin_select"
									style="width: 190px; height: 20px; margin: -2px;"
									onChange="changeF();">
										<option value="" style="color: #c2c2c2;">---请选择---</option>

										<{foreach item=loop from=$locations}>
										<option value="<{$loop.value_info}>"><{$loop.value_info}></option>

										<{/foreach}>

								</select>
							</span> <span
								style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
									<input type="text" name="origin" id="origin"
									value="<{$list.origin}>"
									style="width: 170px; height: 15px; border: 0pt;">
							</span>
							</td>
							<td bgcolor="#f2f2f2" class="left_txt"></td>
						</tr>
						<tr>

							<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;" align="left">destination：
								&nbsp; &nbsp; &nbsp;&nbsp;<span
								style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
									<select name="destination_select" id="destination_select"
									style="width: 190px; height: 20px; margin: -2px;"
									onChange="changeF();">
										<option value="" style="color: #c2c2c2;">---请选择---</option>
										<{foreach item=loop from=$locations}>
										<option value="<{$loop.value_info}>"><{$loop.value_info}></option>

										<{/foreach}>

								</select>
							</span> <{$list.destination = "悉尼"}> <span
								style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
									<input type="text" name="destination" id="destination"
									value="<{$list.destination}>"
									style="width: 170px; height: 15px; border: 0pt;">
							</span>

							</td>
							<td bgcolor="#f2f2f2" class="left_txt"></td>
						</tr>
						<tr>
							<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;" align="left">items：<span
								style="padding-left: 50px;"><input style="width: 188px;"
									type="text" name="items" value="1"></span>
							</td>
							<td bgcolor="#f2f2f2" class="left_txt"></td>
						</tr>

						<tr>
							<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;" align="left">Create with a
								record:<span style="padding-left: 50px;"> <{if
									!($displayRecord)}> <input type='checkbox' unchecked
									onchange='handleChange(this);'> <{else}> <input
									type='checkbox' checked onchange='handleChange(this);'>
									<{/if}>
							</span>
							</td>
							<td bgcolor="#f2f2f2" class="left_txt"></td>
						</tr>
						<tr>
							<td align="left" style="padding-left: 300px; padding-top: 10px"><input
								type="submit" name="submit" value="Submit"></td>
						</tr>
					</table>
				
			</td>
			<td background="images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="bottom" background="images/mail_leftbg.gif"><img
				src="images/buttom_left2.gif" width="17" height="17" /></td>
			<td background="images/buttom_bgs.gif"><img
				src="images/buttom_bgs.gif" width="17" height="17"></td>
			<td valign="bottom" background="images/mail_rightbg.gif"><img
				src="images/buttom_right2.gif" width="16" height="17" /></td>
		</tr>
	</table>

	<{if ($displayRecord)}>

	<table width="99%" border="0" cellspacing="0" cellpadding="0"
		style="padding-left: 10px;">
		<br>
		<tr class="nowtable">
			<td class="left_bt2" style="padding-left: 10px;" colspan="2">Add
				New Record</td>
		</tr>
		<tr>
			<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
				style="padding-left: 10px; padding-top: 15px" align="left">
				Time：<span style="padding-left: 40px;"><input type="text"
					name="datepicker" id="datepicker" class="input"
					value="<{$getTime}>"></span>
			</td>
			<td bgcolor="#f2f2f2" class="left_txt"></td>
		</tr>
		<tr>
			<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
				style="padding-left: 10px; padding-top: 5px" align="left">
				Location：&nbsp; &nbsp; &nbsp; &nbsp; <span
				style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
					<select name="location_select" id="location_select"
					style="width: 190px; height: 20px; margin: -2px;"
					onChange="changeF1();">
						<option value="" style="color: #c2c2c2;">---请选择---</option>

						<{foreach item=loop from=$locations}>
						<option value="<{$loop.value_info}>"><{$loop.value_info}></option>

						<{/foreach}>

				</select>
			</span> <span
				style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
					<input type="text" name="location" id="location"
					value="<{$record_list.location}>"
					style="width: 170px; height: 15px; border: 0pt;">
			</span>
			</td>
			<td bgcolor="#f2f2f2" class="left_txt"></td>
		</tr>
		<tr>
			<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
				style="padding-left: 10px; padding-top: 5px" align="left">
				Details：&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <span
				style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
					<select name="detail_select" id="detail_select"
					style="width: 190px; height: 20px; margin: -2px;"
					onChange="changeF1();">
						<option value="" style="color: #c2c2c2;">---请选择---</option>

						<{foreach item=loop from=$status}>
						<option value="<{$loop.value_info}>"><{$loop.value_info}></option>

						<{/foreach}>

				</select>
			</span> <span
				style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
					<input type="text" name="detail" id="detail"
					value="<{$record_list.detail}>"
					style="width: 170px; height: 15px; border: 0pt;">
			</span>
			</td>
			<td bgcolor="#f2f2f2" class="left_txt"></td>
		</tr>
		<tr>
			<td align="left" style="padding-left: 350px; padding-top: 10px"></td>
		</tr>
	</table>
	<{/if}>
	</form>
</body>
